import request from "../../request";

const api = {
    getPay: '/admin/pay/all',
    update: '/admin/pay/update',
    save: '/admin/pay/save',
    deleteId: '/admin/pay/delete/id=',
    delbatch: '/admin/pay/del/batch',
    payById: '/admin/pay/get-pay/id=',
    payPage: '/admin/pay/page'
}


/**
 * 添加
 * @param data
 * @returns {AxiosPromise}
 */
export function savePayData(param){
    return request({
        url: api.save,
        method: 'POST',
        data: param
    })
}

/**
 * 根据id进行删除
 * @returns {AxiosPromise}
 */
export function delPayByid(id){
  return request({
      url: api.deleteId + id,
      method: 'GET'
  })
}

/**
 * 批量删除
 * @param ids
 * @returns {AxiosPromise}
 */
export function delPayBatch(ids){
  return request({
      url: api.delbatch,
      method: 'POST',
      data: ids
  })
}

/**
 * 修改
 * @param data
 * @returns {AxiosPromise}
 */
export function updatePay(param){
  return request({
      url: api.update,
      method: 'POST',
      data: param
  })
}

/**
 * 查询全部数据
 * @returns {AxiosPromise}
 */
export function getPay(){
  return request({
      url: api.getPay,
      method: 'GET',
  })
}

/**
 * 根据id进行查询
 * @returns {AxiosPromise}
 */
export function getPayByid(id){
  return request({
      url: api.payById + id,
      method: 'GET'
  })
}

/**
 * 分页查询
 * @param data
 * @returns {AxiosPromise}
 */
export function getPayPage(param){
  return request({
      url: api.payPage,
      method: 'GET',
      params: param
  })
}